<script>/* vi:set ts=4 sw=4 expandtab enc=utf8: */</script>
<!--%import("js/package_manage.js")-->
<script type="text/javascript">
    jQuery( function() { jQuery('.grant_default').change( function(event) { doShowGrantZone(); } ); doShowGrantZone() } );
</script>

<input type="hidden" name="granted_member" value="<!--@foreach($granted_member as $key => $val)-->{$val->user_id},<!--@end-->" />
<table cellspacing="0" class="rowTable">
<tr>
    <th scope="row" rowspan="2"><div>아이디 목록</div></th>
    <td class="wide">
        <select name="_granted_member" multiple="multiple" size="{count($granted_member)?count($granted_member):1}" class="w200">
        <!--@foreach($granted_member as $key => $val)-->
            <option value="{$val->user_id}">{$val->nick_name} ({$val->user_id})</option>
        <!--@end-->
        </select>
    </td>
</tr>
<tr>
    <th class="wide">
        <input type="text" name="admin_id" class="inputTypeText w100" />
        <span class="button black strong"><button type="button" onclick="doInsertAdmin(this.form)">{$lang->cmd_insert}</button></span>
        <span class="button"><button type="button" onclick="doDeleteAdmin(this.form)">{$lang->cmd_delete}</button></span>
    </th>
</tr>
</table>
<table cellspacing="0" class="crossTable">
<thead>
<tr>
    <th scope="col"><div>{$lang->grant}</div></th>
    <th scope="col" colspan="3"><div>{$lang->target}</div></th>
</tr>
</thead>
<tbody>
    <!--@foreach($grant_list as $grant_name => $grant_item)-->
    <tr class="row{$cycle_idx}">
        <th scope="row"><div>{$grant_item->title}</div></th>
        <td class="wide">
            <select name="{$grant_name}_default" class="grant_default">
                <!--@if($grant_item->default == 'guest')--><option value="0" <!--@if($default_grant[$grant_name]=='all')-->selected="selected"<!--@end-->>{$lang->grant_to_all}</option><!--@end-->
                <!--@if($grant_item->default != 'manager')--><option value="-1" <!--@if($default_grant[$grant_name]=='member')-->selected="selected"<!--@end-->>{$lang->grant_to_login_user}</option><!--@end-->
                <!--@if($grant_item->default != 'manager')--><option value="-2" <!--@if($default_grant[$grant_name]=='site')-->selected="selected"<!--@end-->>{$lang->grant_to_site_user}</option><!--@end-->
                <option value="" <!--@if($default_grant[$grant_name]=='group')-->selected="selected"<!--@end-->>{$lang->grant_to_group}</option>
            </select>

            <div id="zone_{$grant_name}" style="display:none">
                <!--@foreach($group_list as $group_srl => $group_item)-->
                <input type="checkbox" class="checkbox" name="{$grant_name}" value="{$group_item->group_srl}" id="grant_{$grant_name}_{$group_srl}" <!--@if(is_array($selected_group[$grant_name])&&in_array($group_srl,$selected_group[$grant_name]))-->checked="checked"<!--@end-->/> 
                <label for="grant_{$grant_name}_{$group_srl}">{$group_item->title}</label>
                <!--@end-->
            </div>

        </td>
    </tr>
    <!--@end-->
</tbody>
</table>
